<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>

    async function show () {
      console.log("show()函数");
      return "show函数"
    }
    // // console.log(show());
    // show().then(data => {
    //   console.log(data);
    // })

    function testPro () {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          console.log('Promise函数');
          resolve();
        }, 2000);
      })
    }
    async function testAwait () {
      //异步函数
      await testPro();
      console.log("testAwait()函数");
      setTimeout(() => {
        console.log('testAwait()函数定时器');
      }, 2000);
    }
    testAwait();

  </script>
</body>

</html>